#ifndef SCOOPER_HPP
#define SCOOPER_HPP

#include <QXmlStreamWriter>
#include <cmath>

#include "cluster.hpp"
#include "clusternode.hpp"
#include "volume.hpp"

class Scooper {
  public:
    Scooper();
    Scooper(Volume *volume);
    ~Scooper();
    void setVolume(Volume *volume);
    void scoop();
    void write(const QString &fileName) const;
  private:
    mutable int nodeCounter;
    Volume *volume;
    ClusterNode *root;

    void writeNode(const ClusterNode *node,QXmlStreamWriter &stream) const;
};

#endif
